<?php
return array(


    // register auth services...
    'service_manager' => array(
        'factories' => array(
            'AuthStorage' => 'Admin\Factory\Storage\AuthStorageFactory',
            'Zend\Authentication\AuthenticationService' => 'Admin\Factory\Storage\AuthenticationServiceFactory'
        )
    ),
    'controllers' => array(
        'invokables' => array(
            'Admin\Controller\Category' => 'Admin\Controller\CategoryController',
            'Admin\Controller\Product' => 'Admin\Controller\ProductController',
            'Admin\Controller\User' => 'Admin\Controller\UserController',
            'Admin\Controller\Order' => 'Admin\Controller\OrderController'
        )
    ),
    'router' => array(
        'routes' => array(
            'category' => array(
                'type' => 'segment',
                'options' => array(
                    'route' => '/admin/category[/][:action][/:id][/:urlseo]',
                    'constraints' => array(
                        'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
                        'id' => '[0-9a-zA-Z]*',
                        'urlseo' => '[0-9a-zA-Z-.%]*'
                    ),
                    'defaults' => array(
                        'controller' => 'Admin\Controller\Category',
                        'action' => 'index'
                    )
                )
            ),
            'product' => array(
                'type' => 'segment',
                'options' => array(
                    'route' => '/admin/product[/][:action][/:id][/:urlseo][/:page]',
                    'constraints' => array(
                        'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
                        'id' => '[0-9a-zA-Z]*',
                        'urlseo' => '[0-9a-zA-Z-.%]*',
                        'page' => '[0-9a-zA-Z-.%]*'
                    ),
                    'defaults' => array(
                        'controller' => 'Admin\Controller\Product',
                        'action' => 'index'
                    )
                )
            ),
            'order_admin' => array(
                'type' => 'segment',
                'options' => array(
                    'route' => '/admin/order[/][:action][/:page]',
                    'constraints' => array(
                        'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
                        'page' => '[0-9a-zA-Z-.%]*'
                    ),
                    'defaults' => array(
                        'controller' => 'Admin\Controller\Order',
                        'action' => 'detail'
                    )
                )
            ),

            'user' => array(
                'type' => 'segment',
                'options' => array(
                    'route' => '/admin/user[/][:action][/:id][/:urlseo][/:page]',
                    'constraints' => array(
                        'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
                        'id' => '[0-9a-zA-Z]*',
                        'urlseo' => '[0-9a-zA-Z-.%]*',
                        'page' => '[0-9a-zA-Z-.%]*'
                    ),
                    'defaults' => array(
                        'controller' => 'Admin\Controller\User',
                        'action' => 'login'
                    )
                )
            )
        )
    ),
    'view_manager' => array(
        'template_path_stack' => array(
            'Admin' => __DIR__ . '/../view'
        )
    )
);
